<template>
    <div class="classBaseInfo">
      <el-breadcrumb separator="/" class="breadcrumb-bottom">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>活动管理</el-breadcrumb-item>
        <el-breadcrumb-item>活动列表</el-breadcrumb-item>
        <el-breadcrumb-item>活动详情</el-breadcrumb-item>
      </el-breadcrumb>

      <el-form :model="classBaseInfoForm" :rules="rules" ref="classBaseInfoForm" label-width="0px">
        <el-row :gutter="20">
          <el-col :span="6">
            <el-form-item prop="">
              <el-select v-model="classBaseInfoForm.region" placeholder="请选择活动区域" class="full-line">
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item prop="">
              <el-input v-model="classBaseInfoForm.studentId" placeholder="请输入学生学号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="grid-content"></div>
          </el-col>
          <el-col :span="6" class="overflow-clear">
            <el-button type="primary" @click="submitForm('classBaseInfoForm')" class="float-right">立即搜索</el-button>
          </el-col>
        </el-row>
      </el-form>
      <hr>

      <div>
        <div class="float-left table-title-before">
          班级基本信息管理
        </div>
        <el-button-group style="margin-bottom:4px;" class="float-right">
          <el-button type="primary"><router-link to="/ClassBaseInfoOperate" style="">新增班级</router-link></el-button>
          <el-button type="primary">导入数据</el-button>
          <el-button type="primary">导出数据</el-button>
        </el-button-group>
      </div>

      <el-table
        :data="tableData"
        border
        style="width: 100%">
        <el-table-column
          type="selection"
          width="55">
        </el-table-column>
        <el-table-column
          prop="classId"
          label="班级编号"
          width="180">
        </el-table-column>
        <el-table-column
          prop="className"
          label="班级名称"
          width="180">
        </el-table-column>
        <el-table-column
          prop="abbr"
          label="简称"
          width="180">
        </el-table-column>
        <el-table-column
          prop="belongProfession"
          label="所属专业"
          width="180">
        </el-table-column><el-table-column
        prop="startYear"
        label="入学年份"
        width="180">
      </el-table-column>
        <el-table-column
          prop="trainPlan"
          label="培养方案"
          width="180">
        </el-table-column>
        <el-table-column
          label="操作">
          <template scope="scope">
            <router-link to="/ClassBaseInfoOperate"><i class="el-icon-edit"></i></router-link>
            <!--<router-link to="'/ClassBaseInfoOperate/' + tableData.ClassId"><i class="el-icon-edit"></i></router-link>-->
            <!--<router-link :to="{ name: 'ClassBaseInfoOperate', params: { classId: 02 }}"><i class="el-icon-edit"></i></router-link>-->
          </template>
        </el-table-column>
      </el-table>


      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage4"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="total, sizes, prev, pager, next, jumper"
        :total="400">
      </el-pagination>

    </div>
</template>
<style>
</style>
<script>
    export default{
        name : 'classBaseInfo',
        data(){
            return {
                classBaseInfoForm: {},
                enrollmentTime: '',
                tableData: []
            }
        },
        components:{
        },
        mounted:function(){
            this.$nextTick(function(){
              this.queryRes();
            })
        },
        methods: {
            queryRes:function(){
               this.$http.get('/static/data.json',[]).then(response => {
                    for (const element of response.body.classBaseInfo){
                        this.tableData.push(element);
                    }
              }, response => {
                 console.log('文件获取失败');
              });
            }
        }
    }
</script>
